package com.tenebrous.jestic.proto.connect;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.43.1)",
    comments = "Source: server/server.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ServerAuthorityServiceGrpc {

  private ServerAuthorityServiceGrpc() {}

  public static final String SERVICE_NAME = "com.tenebrous.jestic.proto.connect.ServerAuthorityService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest,
      com.tenebrous.jestic.proto.common.GrpcResponse> getAuthorityMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "authority",
      requestType = com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest.class,
      responseType = com.tenebrous.jestic.proto.common.GrpcResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest,
      com.tenebrous.jestic.proto.common.GrpcResponse> getAuthorityMethod() {
    io.grpc.MethodDescriptor<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest, com.tenebrous.jestic.proto.common.GrpcResponse> getAuthorityMethod;
    if ((getAuthorityMethod = ServerAuthorityServiceGrpc.getAuthorityMethod) == null) {
      synchronized (ServerAuthorityServiceGrpc.class) {
        if ((getAuthorityMethod = ServerAuthorityServiceGrpc.getAuthorityMethod) == null) {
          ServerAuthorityServiceGrpc.getAuthorityMethod = getAuthorityMethod =
              io.grpc.MethodDescriptor.<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest, com.tenebrous.jestic.proto.common.GrpcResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "authority"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tenebrous.jestic.proto.common.GrpcResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ServerAuthorityServiceMethodDescriptorSupplier("authority"))
              .build();
        }
      }
    }
    return getAuthorityMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest,
      com.tenebrous.jestic.proto.common.GrpcResponse> getServerShutDownMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "serverShutDown",
      requestType = com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest.class,
      responseType = com.tenebrous.jestic.proto.common.GrpcResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest,
      com.tenebrous.jestic.proto.common.GrpcResponse> getServerShutDownMethod() {
    io.grpc.MethodDescriptor<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest, com.tenebrous.jestic.proto.common.GrpcResponse> getServerShutDownMethod;
    if ((getServerShutDownMethod = ServerAuthorityServiceGrpc.getServerShutDownMethod) == null) {
      synchronized (ServerAuthorityServiceGrpc.class) {
        if ((getServerShutDownMethod = ServerAuthorityServiceGrpc.getServerShutDownMethod) == null) {
          ServerAuthorityServiceGrpc.getServerShutDownMethod = getServerShutDownMethod =
              io.grpc.MethodDescriptor.<com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest, com.tenebrous.jestic.proto.common.GrpcResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "serverShutDown"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.tenebrous.jestic.proto.common.GrpcResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ServerAuthorityServiceMethodDescriptorSupplier("serverShutDown"))
              .build();
        }
      }
    }
    return getServerShutDownMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static ServerAuthorityServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<ServerAuthorityServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<ServerAuthorityServiceStub>() {
        @java.lang.Override
        public ServerAuthorityServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new ServerAuthorityServiceStub(channel, callOptions);
        }
      };
    return ServerAuthorityServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static ServerAuthorityServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<ServerAuthorityServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<ServerAuthorityServiceBlockingStub>() {
        @java.lang.Override
        public ServerAuthorityServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new ServerAuthorityServiceBlockingStub(channel, callOptions);
        }
      };
    return ServerAuthorityServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static ServerAuthorityServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<ServerAuthorityServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<ServerAuthorityServiceFutureStub>() {
        @java.lang.Override
        public ServerAuthorityServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new ServerAuthorityServiceFutureStub(channel, callOptions);
        }
      };
    return ServerAuthorityServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class ServerAuthorityServiceImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     * 获取认证信息
     * </pre>
     */
    public void authority(com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest request,
        io.grpc.stub.StreamObserver<com.tenebrous.jestic.proto.common.GrpcResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAuthorityMethod(), responseObserver);
    }

    /**
     * <pre>
     * 服务下线
     * </pre>
     */
    public void serverShutDown(com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest request,
        io.grpc.stub.StreamObserver<com.tenebrous.jestic.proto.common.GrpcResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getServerShutDownMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getAuthorityMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest,
                com.tenebrous.jestic.proto.common.GrpcResponse>(
                  this, METHODID_AUTHORITY)))
          .addMethod(
            getServerShutDownMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest,
                com.tenebrous.jestic.proto.common.GrpcResponse>(
                  this, METHODID_SERVER_SHUT_DOWN)))
          .build();
    }
  }

  /**
   */
  public static final class ServerAuthorityServiceStub extends io.grpc.stub.AbstractAsyncStub<ServerAuthorityServiceStub> {
    private ServerAuthorityServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected ServerAuthorityServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new ServerAuthorityServiceStub(channel, callOptions);
    }

    /**
     * <pre>
     * 获取认证信息
     * </pre>
     */
    public void authority(com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest request,
        io.grpc.stub.StreamObserver<com.tenebrous.jestic.proto.common.GrpcResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getAuthorityMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     * 服务下线
     * </pre>
     */
    public void serverShutDown(com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest request,
        io.grpc.stub.StreamObserver<com.tenebrous.jestic.proto.common.GrpcResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getServerShutDownMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class ServerAuthorityServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<ServerAuthorityServiceBlockingStub> {
    private ServerAuthorityServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected ServerAuthorityServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new ServerAuthorityServiceBlockingStub(channel, callOptions);
    }

    /**
     * <pre>
     * 获取认证信息
     * </pre>
     */
    public com.tenebrous.jestic.proto.common.GrpcResponse authority(com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getAuthorityMethod(), getCallOptions(), request);
    }

    /**
     * <pre>
     * 服务下线
     * </pre>
     */
    public com.tenebrous.jestic.proto.common.GrpcResponse serverShutDown(com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getServerShutDownMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class ServerAuthorityServiceFutureStub extends io.grpc.stub.AbstractFutureStub<ServerAuthorityServiceFutureStub> {
    private ServerAuthorityServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected ServerAuthorityServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new ServerAuthorityServiceFutureStub(channel, callOptions);
    }

    /**
     * <pre>
     * 获取认证信息
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.tenebrous.jestic.proto.common.GrpcResponse> authority(
        com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getAuthorityMethod(), getCallOptions()), request);
    }

    /**
     * <pre>
     * 服务下线
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.tenebrous.jestic.proto.common.GrpcResponse> serverShutDown(
        com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getServerShutDownMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_AUTHORITY = 0;
  private static final int METHODID_SERVER_SHUT_DOWN = 1;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final ServerAuthorityServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(ServerAuthorityServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_AUTHORITY:
          serviceImpl.authority((com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerAuthorityRequest) request,
              (io.grpc.stub.StreamObserver<com.tenebrous.jestic.proto.common.GrpcResponse>) responseObserver);
          break;
        case METHODID_SERVER_SHUT_DOWN:
          serviceImpl.serverShutDown((com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.ServerShutDownRequest) request,
              (io.grpc.stub.StreamObserver<com.tenebrous.jestic.proto.common.GrpcResponse>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class ServerAuthorityServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    ServerAuthorityServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.tenebrous.jestic.proto.connect.ServerAuthorityGrpc.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("ServerAuthorityService");
    }
  }

  private static final class ServerAuthorityServiceFileDescriptorSupplier
      extends ServerAuthorityServiceBaseDescriptorSupplier {
    ServerAuthorityServiceFileDescriptorSupplier() {}
  }

  private static final class ServerAuthorityServiceMethodDescriptorSupplier
      extends ServerAuthorityServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    ServerAuthorityServiceMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (ServerAuthorityServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new ServerAuthorityServiceFileDescriptorSupplier())
              .addMethod(getAuthorityMethod())
              .addMethod(getServerShutDownMethod())
              .build();
        }
      }
    }
    return result;
  }
}
